<?php


namespace app\admin\controller;


use think\Controller;

class Index extends Controller
{
    /**
     * 列表展示
     * @return \think\response\View
     */
    public function index()
    {
        $data = getMenuByPid(0);
        $admin_id = session("admin_id");
        $admin = \app\model\Admin::find($admin_id);
        $this->assign([
            'data' => $data,
            'admin' => $admin
        ]);
        return view("index");
    }

    /**
     * 欢迎页面
     * @return \think\response\View
     */
    public function welcome(){
        $admin_id = session("admin_id");
        $admin = \app\model\Admin::find($admin_id);
//        dump($admin);die;
        $this->assign([
            'admin' => $admin,
            'last_login_time' => session("last_login_time")
        ]);
        return view('welcome');
    }
}